package com.funny.stock.data.vo;

/**
 * @author pengl
 * @date 2020/05/02
 **/
public enum  StockType {
    SH("sh","0"),
    SZ("sz","1");

    String type;

    String numberPrefix;

    StockType(String type,String numberPrefix){
        this.type = type;
        this.numberPrefix = numberPrefix;
    }

    public String getType() {
        return type;
    }

    public String getNumberPrefix() {
        return numberPrefix;
    }

    public static StockType getValueByType(String type){
        StockType[] values = StockType.values();
        for (int i = 0; i < values.length; i++) {
            if(values[i].getType().equals(type)){
                return values[i];
            }
        }

        return SH;
    }
}
